//
//  ST_UserSignView.swift
//  btvideo
//
//  Created by mac on 2020/7/22.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit

/**
 会员 和 真人认证  高度 22 宽度 82
 */
class ST_UserSignView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
//        self.backgroundColor = .random
        
        let imageView0 = UIImageView()
        self.addSubview(imageView0)
        imageView0.snp.makeConstraints { (make) in
            make.left.centerY.equalToSuperview()
        }
        
        let imageView1 = UIImageView()
        self.addSubview(imageView1)
        imageView1.snp.makeConstraints { (make) in
            make.right.centerY.equalToSuperview()
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func bind_data(isVip:Bool,detectedFace:Bool){
        
        var images = [UIImage]()
        
        if isVip{
            images.append(SC.YYMemberSignImage)
        }
        
        if detectedFace{
            images.append(SC.YYFaceSignImage)
        }
        
        for (idx,item) in self.subviews.enumerated(){
            
            guard let imgView = item as? UIImageView else { continue }
            
            imgView.image = images[safe:idx]
        }
    }
    
}
